package com.tgy.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/***
 * @ClassName: AsyncService
 * @Description:
 * @Auther: 送一一块二向箔
 * @Date: 14:35 2022/1/7
 * @version : V1.0
 */
@Service
@Slf4j
public class AsyncService {

    @Async
    public void async(){
        try {
            log.info("线程开始{}","begin");
            Thread.sleep(3000);
            log.info("线程结束{}","end");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
